/*
 * Copyright 2009 Andreas Borglin andreas.borglin@gmail.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package borge.mobile.lib.pimp;

/**
 * Implement this interface to get progress updates when image manipulation
 * occurs on the real image. Depending on the number and complexity of the 
 * operations and the image size, it might take a while to perform the operations.
 * @author Andreas Borglin
 */
public interface ProgressListener {

    /**
     * Called for each step in the saving progress
     * @param step String description of the step
     * @param curstep Current step value
     * @param totalsteps Number of total steps
     */
    public void stepUpdate(String step, int curstep, int totalsteps);
    
    /**
     * Called when all operations have been applied and save to file,
     * or on failure.
     * @param success True if all operations saved to file, false if it failed.
     * @param errorMsg Contains error in case of failure. null on success
     */
    public void taskFinished(boolean success, String errorMsg);
    
}
